<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../../vue.js"></script>
  <style>


#box {
  width: 200px;
  height: 200px;
  background: yellowgreen;
  /* animation: move 3s infinite; */
  /* transition: all 3s; */
}

/* #box:hover {
  width: 500px;
} */
/*
enter
enter-active
enter-to
leave
leave-active
leave-to
*/

.fade-leave-to,
.fade-enter {
  opacity: 0;
}

.fade-leave-active,
.fade-enter-active {
  transition: opacity  3s;
}

.fade-leave,
.fade-enter-to {
  opacity: 1;
}

  </style>
</head>
<body>
  <div id="app">
    <button @click="show =!show">显示/隐藏</button>

    <transition name="fade">
      <div id="box"
      v-show="show"
      >
      </div>
    </transition>
  
  </div>

  <script>


var vm = new Vue({
  el:"#app",
  data:{
    show:false
  }
})
  </script>
  
</body>
</html>